chore: enforce uv lockfile consistency in CI and pre-commit#1398
chore: enforce uv lockfile consistency in CI and pre-commit#1398timsaucer merged 2 commits intoapache:mainfrom
Conversation
33bbd9b to
3706f1c
Compare
3706f1c to
05c492c
Compare
.github/workflows/build.yml
Outdated
|
|
||
| - name: Install dependencies | ||
| run: uv sync --dev --no-install-package datafusion | ||
| run: uv sync --locked --dev --no-install-package datafusion |
There was a problem hiding this comment.
I agree with the direction here, and the pre-commit hook looks good.
But given the PR title says this enforces lockfile consistency in CI, I think the CI side is incomplete until all uv sync calls use --locked (or the title/description is narrowed).
There was a problem hiding this comment.
I don't think that's strictly necessary. The check has been added to lint-python job that is a dependency of each of the other jobs where a sync occurs. So it will fail early in the pipeline if the uv lock is not up to date and those other jobs will never run.
If you think it's necessary for completeness sake, and in case we were to ever remove the lint-python job that's a different story. But personally I believe @mesejo 's solution will correctly enforce the requirement he's set out to.
There was a problem hiding this comment.
I decided to set UV_LOCKED=True, this will ensure current (and future calls) of uv sync use --locked
Add --locked flag to uv sync in CI to fail if uv.lock is out of sync, and add the uv-lock pre-commit hook to automatically keep uv.lock up to date when pyproject.toml changes.
05c492c to
cd2825a
Compare
|
thank you @mesejo ! |
Which issue does this PR close?
N/A
Rationale for this change
The uv.lock is out of sync
Add UV_LOCKED=True to uv sync in CI to fail if uv.lock is out of sync,
and add the uv-lock pre-commit hook to automatically keep uv.lock
up to date when pyproject.toml changes.
Are there any user-facing changes?
No